#include "modman.h"
#include <sys/timeb.h>
#include "ModmanDriverManager.h"
#include<map>

using namespace std;

ModmanDriverManager::ModmanDriverManager() {

}
ModmanDriverManager::~ModmanDriverManager() {

}

ModManDriver* ModmanDriverManager::getModManDriver(uint8_t hm) {
	return m_modmanDriverMap[hm];
}

ModManDriver* ModmanDriverManager::createModManDriver(uint8_t hm) {
	if (m_modmanDriverMap.count(hm) > 0) {
		return m_modmanDriverMap[hm];
	}
	ModManDriver * modmanDriver =new ModManDriver(hm);
	m_modmanDriverMap[hm] = modmanDriver;
	return modmanDriver;
}

void ModmanDriverManager::removeModManDriver(uint8_t hm) {
	if (m_modmanDriverMap.count(hm) > 0) {
		delete m_modmanDriverMap[hm];
		m_modmanDriverMap.erase(hm);
	}
}
